﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UlsStudio.DesktopApp
{
    public partial class AboutForm : Form
    {
        public AboutForm()
        {
            InitializeComponent();
        }

        private void btnIconsLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.mezzoblue.com/icons/chalkwork/");
        }

        private void AboutForm_Load(object sender, EventArgs e)
        {
            lblProductName.Text = Application.ProductName;
            lblVersionInfo.Text = Application.ProductVersion;
        }

        private void lnkSqlLite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://sqlite.org/copyright.html");
        }

        private void lnkMyEmail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                System.Diagnostics.Process.Start("mailto:sambetts@microsoft.com?Subject=" + lblProductName.Text);
            }
            catch (Win32Exception)
            {
                // Email open failed
                string errBody =
                    "Oops, that didn't work, probably because there's no email application installed." + Environment.NewLine + Environment.NewLine +
                    "If you get time please just send me an email as you see fit - sambetts@microsoft.com - it's always truly appreciated!";

                MessageBox.Show(errBody, "Email", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            
        }

        private void lnkCodePlex_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://uls.codeplex.com/");
        }
    }
}
